const express = require('express')
const router = express.Router()
const config = require('../config');
const expressJWT = require('express-jwt');

const address_handler = require('../router_handler/receiverAds')

//添加收货地址
router.post('/upaddress', expressJWT({ secret: config.jwtSecretKey }), address_handler.upaddress)
//获取当前用户收货地址
router.get('/addressinfo', expressJWT({ secret: config.jwtSecretKey }), address_handler.getAddressInfo)
//修改收货地址
router.post('/updateaddress', expressJWT({ secret: config.jwtSecretKey }), address_handler.updateAddress)
//删除收货地址
router.post('/deleteaddress', expressJWT({ secret: config.jwtSecretKey }), address_handler.deleteaddress)

module.exports = router